<?
	include('top.php');
	include('conn.php');
	session_start();
	$msg='';
	if($_REQUEST['up']=='true' and isset($_REQUEST['name']))
	{
		$name=$_REQUEST['name'];
		$sqledit="select * from bankmast where status=0 and bankname='".$name."'";
		$resedit=mysql_query($sqledit);
		$rowedit=mysql_fetch_assoc($resedit);		
	}
	if($_REQUEST['submit']=='Update')
	{
		$bankname=$_REQUEST['bankname'];
		$address=$_REQUEST['address'];
		$city=$_REQUEST['city'];
		$enteredby=$_SESSION['username'];
		$bankid=$_REQUEST['bankid'];
		$sql="update bankmast set bankname='".strtoupper($bankname)."',address='".strtoupper($address)."',city='".strtoupper($city)."'	where bankid= $bankid";
		$res=mysql_query($sql);
		if($res)
		{
			 echo "<script>window.location.href = 'bankmaster.php'</script>";
		}	
		else
		{
			$msg='';			
		}
	}	
?>
<div  align="center">
			<div ng-controller="SearchCtrl">
			<form name="bankedit" action="bankedit.php" method="post">
			<input type="hidden" name="bankid" id="bankid" value="<?=$rowedit['bankid']?>" />
			<table  cellpadding="4" id="box-table-a" cellspacing="4" border="1" width="650" bgcolor="#000000" style="background-color:#DFEBF9;">
				<tr><td colspan="3" align="center" style="text-align:center; color:#FF0000;"><?=$msg?></td></tr>
				<tr>
				  <td colspan="3" align="center" style="text-align:center; font-weight:bold;">Bank Master (Edit)</td>
				</tr>
				<tr bgcolor="#FFFFFF">
					<td ><label style="text-align:left; font-size:14px; color:#333333; font-weight:bold; vertical-align:middle;">Name</label></td>
					<td ><label style="text-align:left; font-size:14px; color:#333333; font-weight:bold; vertical-align:middle;">:</label></td>
					<td style="text-align:left; font-size:14px; color:#333333; font-weight:bold; vertical-align:middle;">
						<input type="text" id="bankname" name="bankname" class="smallInput" required= "" value="<?=$rowedit['bankname']?>" ng-model="bankname" style="width:280px; text-align:left; font-size:12px; font-weight:bold;" />
					</td>
				</tr>
				<tr bgcolor="#FFFFFF">
					<td ><label style="text-align:left; font-size:14px; color:#333333; font-weight:bold; vertical-align:middle;">Address</label></td>
					<td ><label style="text-align:left; font-size:14px; color:#333333; font-weight:bold; vertical-align:middle;">:</label></td>
					<td style="text-align:left; font-size:14px; color:#333333; font-weight:bold; vertical-align:middle;">
					 <textarea name="address" cols="45" rows="3" class="smallInput" id="address"  ng-model="address" style="font-size:12px; text-align:left; font-weight:bold;"><?=$rowedit['address']?></textarea>
					</td>
				</tr>
				<tr bgcolor="#FFFFFF">
					<td ><label style="text-align:left; font-size:14px; color:#333333; font-weight:bold; vertical-align:middle;">City</label></td>
					<td ><label style="text-align:left; font-size:14px; color:#333333; font-weight:bold; vertical-align:middle;">:</label></td>
					<td style="text-align:left; font-size:14px; color:#333333; font-weight:bold; vertical-align:middle;">
						<input type="text" id="city" name="city" class="smallInput" required= "" ng-model="city" placeholder="City" value="<?=$rowedit['city']?>" style="width:180px; text-align:left; font-size:12px; font-weight:bold;" />
					</td>
				</tr>
				<tr>
					<td align="center" colspan="3" style="background-color:#BBE2EE">
					<button type="submit" class="btn" name="submit" value="Update">Update</button>
					</td>
				</tr>
			</table>
			</form>
		</div>
			
</div>
</body>
</html>
